<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Get EJScreen results near each site, compiled as a table, with map and plot — ejscreenit • EJAM</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.4.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Get EJScreen results near each site, compiled as a table, with map and plot — ejscreenit"><meta name="description" content="This is the main high-level function that does all the work involved in
using the EJScreen API outside of the web app to get results for
multiple locations compiled in one table."><meta property="og:description" content="This is the main high-level function that does all the work involved in
using the EJScreen API outside of the web app to get results for
multiple locations compiled in one table."><meta property="og:image" content="https://usepa.github.io/EJAM/logo.svg"></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>


    <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">

    <a class="navbar-brand me-2" href="../index.html">EJAM</a>

    <small class="nav-text text-warning me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">2.32.0</small>


    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
<li class="nav-item dropdown">
  <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
  <ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><hr class="dropdown-divider"></li>
    <li><h6 class="dropdown-header" data-toc-skip>Overview for EJAM Users</h6></li>
    <li><a class="dropdown-item" href="../articles/0_whatis.html">What is EJAM</a></li>
    <li><a class="dropdown-item" href="../articles/0_webapp.html">Using EJAM</a></li>
    <li><hr class="dropdown-divider"></li>
    <li><h6 class="dropdown-header" data-toc-skip>For analysts using R</h6></li>
    <li><a class="dropdown-item" href="../articles/1_installing.html">Installing the EJAM R package</a></li>
    <li><a class="dropdown-item" href="../articles/2_quickstart.html">Quick Start Guide</a></li>
    <li><a class="dropdown-item" href="../articles/3_analyzing.html">Basics of Using EJAM for Analysis in RStudio</a></li>
    <li><a class="dropdown-item" href="../articles/4_advanced.html">Advanced Features</a></li>
  </ul></li>
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
      </ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
 <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/USEPA/EJAM/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
      </ul></div>


  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.svg" class="logo" alt=""><h1>Get EJScreen results near each site, compiled as a table, with map and plot</h1>
      <small class="dont-index">Source: <a href="https://github.com/USEPA/EJAM/blob/HEAD/R/ejscreenit.R" class="external-link"><code>R/ejscreenit.R</code></a></small>
      <div class="d-none name"><code>ejscreenit.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>This is the main high-level function that does all the work involved in
using the EJScreen API outside of the web app to get results for
multiple locations compiled in one table.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">ejscreenit</span><span class="op">(</span></span>
<span>  <span class="va">x</span>,</span>
<span>  y <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  radius <span class="op">=</span> <span class="fl">3</span>,</span>
<span>  maxradiusmiles <span class="op">=</span> <span class="fl">10</span>,</span>
<span>  fips <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  shapefile <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  namestr <span class="op">=</span> <span class="st">""</span>,</span>
<span>  nosave <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  nosee <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  save_map <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  see_map <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  save_plot <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  see_plot <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  save_table <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  see_table <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  interactiveprompt <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  calculate_ratios <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  nicenames <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  folder <span class="op">=</span> <span class="st">"."</span>,</span>
<span>  getstatefromplacename <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>


<dl><dt id="arg-x">x<a class="anchor" aria-label="anchor" href="#arg-x"></a></dt>
<dd><p>Point locations may be specified in several ways:</p><ul><li><p>x can be a vector of longitudes (decimal degrees),
in which case y also must be provided as latitudes; or</p></li>
<li><p>x can be the path/filename to a file in .xlsx or .csv format with lat, lon header names</p></li>
<li><p>x can be a data.frame, data.table, or matrix (or list) with lat,lon as column names (or names of list elements)</p></li>
<li><p>x can be omitted if one is using RStudio interactively, in which case the user is
prompted to select a file from a local drive.</p></li>
</ul></dd>


<dt id="arg-y">y<a class="anchor" aria-label="anchor" href="#arg-y"></a></dt>
<dd><p>latitudes, or ignored if x was a file or table with lat,lon info.</p></dd>


<dt id="arg-radius">radius<a class="anchor" aria-label="anchor" href="#arg-radius"></a></dt>
<dd><p>in miles - gets data on all residents within that distance from each point</p></dd>


<dt id="arg-maxradiusmiles">maxradiusmiles<a class="anchor" aria-label="anchor" href="#arg-maxradiusmiles"></a></dt>
<dd><p>optional in case you want to use a radius of more than default cap</p></dd>


<dt id="arg-fips">fips<a class="anchor" aria-label="anchor" href="#arg-fips"></a></dt>
<dd><p>if used instead of x,y it can specify fips codes of counties, tracts, or blockgroups</p></dd>


<dt id="arg-shapefile">shapefile<a class="anchor" aria-label="anchor" href="#arg-shapefile"></a></dt>
<dd><p>not implemented</p></dd>


<dt id="arg-namestr">namestr<a class="anchor" aria-label="anchor" href="#arg-namestr"></a></dt>
<dd><p>optional text</p></dd>


<dt id="arg-nosave">nosave<a class="anchor" aria-label="anchor" href="#arg-nosave"></a></dt>
<dd><p>logical, if TRUE, sets as FALSE and overrides save_map, save_plot, save_table. Ignored if FALSE.</p></dd>


<dt id="arg-nosee">nosee<a class="anchor" aria-label="anchor" href="#arg-nosee"></a></dt>
<dd><p>logical, if TRUE, sets as FALSE and overrides see_map, see_plot, see_table. Ignored if FALSE.</p></dd>


<dt id="arg-save-map">save_map<a class="anchor" aria-label="anchor" href="#arg-save-map"></a></dt>
<dd><p>logical, whether to save png image file locally</p></dd>


<dt id="arg-see-map">see_map<a class="anchor" aria-label="anchor" href="#arg-see-map"></a></dt>
<dd><p>logical, whether to display interactive map</p></dd>


<dt id="arg-save-plot">save_plot<a class="anchor" aria-label="anchor" href="#arg-save-plot"></a></dt>
<dd><p>logical, whether to save png image file locally</p></dd>


<dt id="arg-see-plot">see_plot<a class="anchor" aria-label="anchor" href="#arg-see-plot"></a></dt>
<dd><p>logical, whether to display plot (boxplots)</p></dd>


<dt id="arg-save-table">save_table<a class="anchor" aria-label="anchor" href="#arg-save-table"></a></dt>
<dd><p>logical, whether to save table of data in a file locally</p></dd>


<dt id="arg-see-table">see_table<a class="anchor" aria-label="anchor" href="#arg-see-table"></a></dt>
<dd><p>logical, whether to display interactive table</p></dd>


<dt id="arg-interactiveprompt">interactiveprompt<a class="anchor" aria-label="anchor" href="#arg-interactiveprompt"></a></dt>
<dd><p>logical, whether to prompt for upload of file and ask to hit key to continue after map shown, etc.
If interactive() is TRUE, this actually defaults to TRUE.</p></dd>


<dt id="arg-calculate-ratios">calculate_ratios<a class="anchor" aria-label="anchor" href="#arg-calculate-ratios"></a></dt>
<dd><p>whether to add columns with ratio of raw score to the US or State average</p></dd>


<dt id="arg-nicenames">nicenames<a class="anchor" aria-label="anchor" href="#arg-nicenames"></a></dt>
<dd><p>whether to use long plain english headers in table or R variable names,
e.g.,  "Particulate Matter (PM 2.5 in ug/m3)" not "pm"</p></dd>


<dt id="arg-folder">folder<a class="anchor" aria-label="anchor" href="#arg-folder"></a></dt>
<dd><p>full path of directory in which to save files like map, plot, table
Default is working directory.</p></dd>


<dt id="arg-getstatefromplacename">getstatefromplacename<a class="anchor" aria-label="anchor" href="#arg-getstatefromplacename"></a></dt>
<dd><p>set to FALSE if you need the exact output of API and
TRUE if you want to try to extract ST abbrev and statename from the placename field,
which is more likely to be correct than the stateAbbr and stateName fields in the API output.</p></dd>


<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
<dd><p>passed to <code><a href="ejscreenapi_plus.html">ejscreenapi_plus()</a></code></p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
    <p>Returns a list with map, boxplot, table</p><ul><li><p>map of sites with popups of EJ stats, as returned plot,
viewed interactive map and .png</p></li>
<li><p>graphic boxplot of some demographics as ratios to average, as returned plot,
viewed noninteractive plot and .png</p></li>
<li><p>table of results as a returned data.frame,
viewed interactive datatable, and .xlsx and .csv
Which includes us.ratios and state.ratios via one row per site
and one column per indicator as ratios to US and to State average.</p>
<p>It also now drops redundant columns where the same numbers had been returned from API
using the normal name and a synonym name.</p></li>
</ul></div>
    <div class="section level2">
    <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
    <p>This function provides EJScreen indicator results near each of a list of sites,
all in one function, for those who want to do so in RStudio (for interactive analysis)
or via their own software/apps (programmatically)
rather than through the web app interface. It is an alternative to EJAM, as
explained below.</p>
<p>Based on a set of places, <code>ejscreenit()</code> requests an EJScreen standard report for each place
and assembles all those results as a single spreadsheet. The indicators include
demographic and environmental indicators as well as EJ Indexes that combine them,
and some geospatial information about each site.</p>
<p><code>ejscreenit()</code> is the basic, high-level tool that enables easy access to the EJScreen API
for a list of sites, outside the context of a web app. It accepts lat/lon values
flexibly and interactively in the R console,
and then uses the helper functions below to return a list of 3 objects:</p><ul><li><p>a table</p></li>
<li><p>an interactive map (html widget with popups in R console or saved as html file)</p></li>
<li><p>plot of some indicators over the range of sites</p></li>
</ul><p>The table it provides uses plain-English column headers, such as
"Traffic Proximity and Volume (daily traffic count/distance to road)"</p>
    </div>
    <div class="section level2">
    <h2 id="ejam-vs-ejscreen">EJAM vs EJScreen<a class="anchor" aria-label="anchor" href="#ejam-vs-ejscreen"></a></h2>
    <p>To obtain <em>overall summary</em> statistics (and faster results) use ejamit()
from the EJAM package instead of ejscreenit().
The two tools, ejamit() and ejscreenit(), are different, and have pros and cons:</p>
<p>The key advantages of EJAM are</p><ol><li><p><em>ejscreenit / EJScreen API is much, much slower than EJAM</em></p></li>
<li><p><em>ejscreenit cannot provide an overall summary across sites, while EJAM can</em></p></li>
</ol><p>An "overall summary" here means, for example, the overall percent low income
among all unique residents near any one or more of the sites.
This inability to provide an overall summary aggregating across sites
is due to limitations of the EJScreen API
– it does not provide all data needed to correctly aggregate across sites
(see detailed explanation in the ejscreenapi About document).</p>
    </div>
    <div class="section level2">
    <h2 id="inputs-and-outputs">Inputs and Outputs<a class="anchor" aria-label="anchor" href="#inputs-and-outputs"></a></h2>
    <p>The ejscreenit() function accepts a set of points (locations) and a radius, and then
accesses EJScreen (the server via API) to assemble a list of results
similar to the EJScreen standard report but for each of many sites.</p>
<p>Points can be specified in several ways:</p><ul><li><p>as a table (columns lat, lon that are the geographic coordinates)</p></li>
<li><p>in a spreadsheet file with that info (named, or pointed to interactively in RStudio)</p></li>
</ul><p>The function returns a list of items: table, map, plot</p><ul><li><p>a table of scores that are like the EJScreen standard buffer report, but with one row per site (input point)</p><ul><li><p>and as a set of columns in that table, a set of ratios, which are the
indicator value nearby a site divided by the indicator value in the US overall
(which puts all indicators in common units, facilitating comparisons,
offering a summary statistic that is complementary to the percentile but may be more useful in some cases)</p></li>
</ul></li>
<li><p>a map with interactivity and popups of results at each point</p></li>
<li><p>a plot/graphic visualization of the range of sites</p></li>
</ul></div>
    <div class="section level2">
    <h2 id="details-of-helper-functions-used">Details of helper functions used<a class="anchor" aria-label="anchor" href="#details-of-helper-functions-used"></a></h2>
    <p>This function works by requesting each site report from EPA servers
via the <a href="https://ejscreen.epa.gov/mapper/ejscreenapi1.html" class="external-link">EJScreen API</a>
using various helper functions.
It uses functions including the following:</p><ul><li><p><code>ejscreenit()</code> is the basic, high-level tool that enables access to the EJScreen API
for a list of sites, outside the context of a web app. It accepts lat/lon values flexibly and interactively in the R console,
and then uses the helper functions below to return a list of 3 objects: a table, interactive map, and plot.
The table it provides uses plain-English column headers, such as
"Traffic Proximity and Volume (daily traffic count/distance to road)"</p><ul><li><p><code><a href="ejscreenapi_plus.html">ejscreenapi_plus()</a></code> can accept a file of point data, uses <code><a href="ejscreenapi.html">ejscreenapi()</a></code> to get EJScreen stats,
and then prepends input table and renames columns as R variables like "traffic.score"</p><ul><li><p><code><a href="ejscreenapi.html">ejscreenapi()</a></code>  gets EJ stats for many points as a data.table of many rows.</p></li>
<li><p><code><a href="ejscreenapi1.html">ejscreenapi1()</a></code> gets EJ stats for 1 point via API, as data.frame of 1 row.</p></li>
<li><p><code><a href="ejscreenRESTbroker.html">ejscreenRESTbroker()</a></code> gets EJ stats for one point as JSON.</p></li>
</ul></li>
</ul></li>
</ul><p>Also used are
<code><a href="ejscreenapi_plus.html">ejscreenapi_plus()</a></code>, <code><a href="ejscreenapi.html">ejscreenapi()</a></code>, <code><a href="urls_clusters_and_sort_cols.html">urls_clusters_and_sort_cols()</a></code>,
<code><a href="fixcolnames.html">fixcolnames()</a></code>, <code><a href="url_linkify.html">url_linkify()</a></code>, <code><a href="popup_from_ejscreen.html">popup_from_ejscreen()</a></code>, <code><a href="calc_ratios_to_avg.html">calc_ratios_to_avg()</a></code>, <code><a href="boxplots_ratios.html">boxplots_ratios()</a></code></p>
    </div>
    <div class="section level2">
    <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
    <div class="dont-index"><p><code><a href="ejscreenapi_plus.html">ejscreenapi_plus()</a></code></p></div>
    </div>

    <div class="section level2">
    <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span> <span class="co"># \dontrun{</span></span>
<span> <span class="va">pts</span> <span class="op">&lt;-</span> <span class="va">testpoints_50</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">3</span>, <span class="op">]</span> <span class="co"># sample data from package</span></span>
<span> <span class="fu"><a href="mapfast.html">mapfast</a></span><span class="op">(</span><span class="va">pts</span><span class="op">)</span></span>
<span> <span class="co">#pts &lt;- system.file("testdata/latlon/testpoints_10.xlsx", package="EJAM") </span></span>
<span> <span class="kw">if</span> <span class="op">(</span><span class="va">interactive</span><span class="op">)</span></span>
<span> </span>
<span> <span class="va">x</span> <span class="op">&lt;-</span> <span class="fu">ejscreenit</span><span class="op">(</span><span class="va">pts</span>, </span>
<span>   save_map <span class="op">=</span> <span class="cn">F</span>, save_plot <span class="op">=</span> <span class="cn">F</span>, save_table <span class="op">=</span> <span class="cn">F</span>, folder <span class="op">=</span> <span class="st">"~"</span>, see_table <span class="op">=</span> <span class="cn">T</span><span class="op">)</span></span>
<span> </span>
<span> <span class="va">myradius</span> <span class="op">&lt;-</span> <span class="fl">1</span> <span class="co"># in miles</span></span>
<span> <span class="co"># myradius &lt;- 5000 / meters_per_mile # 5 kilometer radius, approx 3.1 miles</span></span>
<span> <span class="co"># Get results from server by using API </span></span>
<span> <span class="va">x</span> <span class="op">&lt;-</span> <span class="fu">ejscreenit</span><span class="op">(</span></span>
<span>   pts<span class="op">=</span><span class="va">pts</span>, radius <span class="op">=</span> <span class="va">myradius</span>,</span>
<span>   save_table <span class="op">=</span> <span class="cn">FALSE</span>, save_map <span class="op">=</span> <span class="cn">FALSE</span>, save_plot <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span>
<span>  </span>
<span> <span class="co"># see format of output results</span></span>
<span> <span class="fu"><a href="https://rdrr.io/r/base/names.html" class="external-link">names</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span> <span class="co"># [1] "table" "map"   "plot"</span></span>
<span> </span>
<span> <span class="va">y</span> <span class="op">=</span> <span class="fu"><a href="ejscreenapi_plus.html">ejscreenapi_plus</a></span><span class="op">(</span><span class="va">pts</span>, radius <span class="op">=</span> <span class="va">myradius</span><span class="op">)</span></span>
<span> <span class="fu"><a href="https://rdrr.io/r/base/all.equal.html" class="external-link">all.equal</a></span><span class="op">(</span><span class="va">x</span><span class="op">$</span><span class="va">table</span>, <span class="va">y</span><span class="op">)</span></span>
<span> </span>
<span> <span class="co"># For this table view, remove map and pdf URL columns </span></span>
<span> <span class="va">y</span> <span class="op">&lt;-</span> <span class="va">x</span><span class="op">$</span><span class="va">table</span><span class="op">[</span> , <span class="op">!</span><span class="fu"><a href="https://rdrr.io/r/base/grep.html" class="external-link">grepl</a></span><span class="op">(</span><span class="st">"EJScreen"</span>, <span class="fu"><a href="https://rdrr.io/r/base/names.html" class="external-link">names</a></span><span class="op">(</span><span class="va">x</span><span class="op">$</span><span class="va">table</span><span class="op">)</span><span class="op">)</span><span class="op">]</span> </span>
<span> <span class="fu"><a href="https://rdrr.io/r/base/t.html" class="external-link">t</a></span><span class="op">(</span><span class="va">y</span><span class="op">[</span><span class="fl">1</span>, <span class="op">]</span><span class="op">)</span>  <span class="co"># see one column of results</span></span>
<span> <span class="fu">DT</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/DT/man/datatable.html" class="external-link">datatable</a></span><span class="op">(</span><span class="va">y</span><span class="op">)</span>  <span class="co"># see interactive data table view in viewer of RStudio</span></span>
<span> </span>
<span> <span class="co"># View links in RStudio Viewer window rather than shiny app or Excel </span></span>
<span> <span class="fu">html_print</span><span class="op">(</span><span class="fu">HTML</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">paste</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">paste</a></span><span class="op">(</span><span class="va">x</span><span class="op">$</span><span class="va">table</span><span class="op">[</span>,<span class="st">"EJScreen Report"</span><span class="op">]</span>, collapse<span class="op">=</span><span class="st">"&lt;br&gt;"</span><span class="op">)</span>,</span>
<span>    <span class="st">"&lt;p&gt;&lt;/p&gt;"</span>, <span class="fu"><a href="https://rdrr.io/r/base/paste.html" class="external-link">paste</a></span><span class="op">(</span><span class="va">x</span><span class="op">$</span><span class="va">table</span><span class="op">[</span>,<span class="st">"EJScreenMAP"</span><span class="op">]</span>, collapse<span class="op">=</span><span class="st">"&lt;br&gt;"</span><span class="op">)</span> <span class="op">)</span>  <span class="op">)</span><span class="op">)</span></span>
<span> </span>
<span> <span class="co"># View the boxplots of results</span></span>
<span> <span class="va">x</span><span class="op">$</span><span class="va">plot</span></span>
<span> </span>
<span> <span class="co"># Save the plot as a file:</span></span>
<span> </span>
<span> <span class="co"># You can save it while running ejscreenit()</span></span>
<span> <span class="co"># by including the parameters save_map = T, nosave = F, folder = "."</span></span>
<span> <span class="co"># or afterwords like this:</span></span>
<span> </span>
<span> <span class="fu"><a href="https://rdrr.io/r/grDevices/png.html" class="external-link">png</a></span><span class="op">(</span>filename <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/file.path.html" class="external-link">file.path</a></span><span class="op">(</span><span class="va">folder</span>,<span class="st">"Boxplot of EJ stats.png"</span><span class="op">)</span>, </span>
<span>   width <span class="op">=</span> <span class="fl">1200</span>, height <span class="op">=</span> <span class="fl">600</span><span class="op">)</span></span>
<span> <span class="va">x</span><span class="op">$</span><span class="va">plot</span></span>
<span> <span class="fu"><a href="https://rdrr.io/r/grDevices/dev.html" class="external-link">dev.off</a></span><span class="op">(</span><span class="op">)</span></span>
<span> </span>
<span> <span class="co"># Save the map as a file:</span></span>
<span> </span>
<span> <span class="co"># You can save the map while running ejscreenit()</span></span>
<span> <span class="co"># by including the parameters save_plot = T, nosave = F, folder = "."</span></span>
<span> <span class="co"># or afterwords save as an interactive HTML webpage, like this:</span></span>
<span> </span>
<span> <span class="co"># htmltools::save_html(x$map, "mapfile.html")</span></span>
<span> </span>
<span> <span class="co"># or make it printable as a static file like this:</span></span>
<span> <span class="va">x</span><span class="op">$</span><span class="va">map</span> <span class="op">%&gt;%</span> <span class="fu">leaflet.extras2</span><span class="fu">::</span><span class="fu"><a href="https://trafficonese.github.io/leaflet.extras2/reference/easyprintMap.html" class="external-link">easyprintMap</a></span><span class="op">(</span></span>
<span>   filename <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/file.path.html" class="external-link">file.path</a></span><span class="op">(</span><span class="va">folder</span>, <span class="st">"map.png"</span><span class="op">)</span>, exportOnly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="op">}</span> <span class="co"># }</span></span>
<span></span></code></pre></div>
    </div>
  </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
    </nav></aside></div>


    <footer><div class="pkgdown-footer-left">
  <p>US EPA 2024</p>
</div>

<div class="pkgdown-footer-right">
  <p>EJAM Version 2.32.0</p>
</div>

    </footer></div>





  </body></html>

